All Questions
8 questions
2votes
0answers
101views
How to Use Webpack with WordPress Script Modules and Enqueue a Custom Class
I am working on a WordPress project using version 6.5, which introduced support for JavaScript modules. I have a parent theme that exports a JavaScript class, and I want to import this class in a ...
0votes
1answer
103views
How to load Javascript code or functions.php later in a child theme?
I'm placing some JS code in functions.php in my child theme but it loads first than anything else. Thus, I'm trying to get it to load later than the rest cos it needs Jquery. I tried enqueuing WP's ...
0votes
0answers
121views
Enqueued script fails
function my_scripts_method() { wp_enqueue_script( 'custom-script', get_stylesheet_directory_uri() . "/js/custom_script.js array( 'query' ),'',true ); } add_action( '...
1vote
1answer
703views
Adding tawk.to code just before body tag on functions.php file
I would like to add tawk.to widget script just before the body tag. I would like to add the code to the functions.php file of my child theme. How can I do this? A code sample will assist a long way. ...
1vote
0answers
28views
How to integrate my HTML and javascript into my child theme
I have a javascript script, html, and css I put together on JSfiddle that I now need to essentially put on a page in wordpress. I'm using a child of the generatePress theme. I'm doing it this way ...
0votes
1answer
66views
Javascript asset not enqueuing with the rest
I am working on a project that uses the child-theme's functions file to enqueue a stylesheet and a single javascript file. These two resources are enqueued well. However, when I add a new compiled ...
0votes
0answers
63views
JavaScript code do not works on online server
I am using a jQuery Image Zoom plugin (http://jacklmoore.com/zoom/) in my wordpress website. The matter is that it works fine in my local machine, but on online server don't work. The JavaScript ...
0votes
0answers
261views
wp_enqueue_scripts doesn't work for template pages
In my child theme's functions.php I wrote : function add_js() { echo "path is : ".get_stylesheet_directory_uri().'/js/script.js'; wp_enqueue_script( 'script', get_stylesheet_directory_uri().'/...